import getState from "@/api/state";
import ZuiEchart from "@/template/zuiEchart/zuiEchart";
import React from "react";
import { useEffect } from "react";
import { useState } from "react";

const Base13 = ({ condition }) => {

    const [message, setMessage] = useState("暂无数据");
    const [loading, setLoading] = useState(true);
    const [state, setState] = useState({
        data: []
    })

    useEffect(() => {
        getState({
            apiUrl: "/cifgp-core-api/baseQuery/pieChart",
            state,
            condition: { ...condition, cType: "baseParentRelation" },
            setState,
            setLoading,
            setMessage,
        })
    }, [condition])

    return (
        <>
            <ZuiEchart
               message={message}
               loading={loading}
                style={{ width: "30%" }}
                title="父母数量统计"
                defaultModule={"pie"}
                pieType="2"
                data={[state]}
                hideBtn
                unit="个"
            />
        </>
    )
}
export default Base13;